class num26 {
    public int removeDuplicates(int[] nums) {
        int fir = 0;
        int sec = 1;
        while (sec < nums.length){
            if(nums[sec] != nums[fir]){
                nums[++fir] = nums[sec];
            }
          sec++;
        }
        return fir + 1;
    }
}